var jsu_ciga_list = function () {
    this.getHTML = function (baseroot, jparam, data) {
        if (!baseroot) {
            baseroot = '';
        }
        if (!jparam || $.getObjectAttrCount(jparam) == 0) {
            var jparam = new Object();
            var rows = this.getParams();
            for (var i = 0; i < rows.length; i++) {
                var row = rows[i];
                jparam[row.field] = row.value;
            }
        }
        var html = new Array();
        var id = $.getUUID();
        html.push('<input type="hidden" id="ciga_list_condition" value="{}">');
        html.push('<div class="ciga_list">');
        html.push('	<div class="clearfix main_wrap">');
        html.push('		<div class="crumbs clearfix">');
        html.push('			<i style="background-image:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);"></i>您现在的位置：<a href="javascript:;" onclick="$.go_index()">商城首页</a><span class="crumbs_sep">></span><span id="ciga_category_item">卷烟目录</span>');
        html.push('		</div>');
        html.push('		<div id="ciga_list_nav" class="clearfix ciga_list_nav">');
        html.push('			<div id="ciga_list_nav_info" class="ciga_list_nav_info text_warning">共<span id="ciga_list_count">0</span>个相关产品</div>');
        html.push('			<div onclick="ciga_list_nav_condition_clearall()" class="ciga_list_nav_condition_area">首页</div>');
        html.push('			<div tag="company" class="ciga_list_nav_condition_area" style="display:none;">></div>');
        html.push('			<div tag="company" class="ciga_list_nav_condition_area" style="display:none;">');
        html.push('				<div class="ciga_list_nav_condition_area_div">');
        html.push('					<div class="ciga_list_nav_condition_area_div_text">');
        html.push('						<span class="ciga_list_nav_condition_area_div_text_tag">工业公司</span>：<span class="ciga_list_nav_condition_area_div_text_tagvalue"></span>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_nav_condition_area_div_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-638px -24px;"></div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('			<div tag="pinpai" class="ciga_list_nav_condition_area" style="display:none;"> > </div>');
        html.push('			<div tag="pinpai" class="ciga_list_nav_condition_area" style="display:none;">');
        html.push('				<div class="ciga_list_nav_condition_area_div">');
        html.push('					<div class="ciga_list_nav_condition_area_div_text">');
        html.push('						<span class="ciga_list_nav_condition_area_div_text_tag">品牌</span>：<span class="ciga_list_nav_condition_area_div_text_tagvalue"></span>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_nav_condition_area_div_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-638px -24px;"></div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('			<div tag="price" class="ciga_list_nav_condition_area" style="display:none;"> > </div>');
        html.push('			<div tag="price" class="ciga_list_nav_condition_area" style="display:none;">');
        html.push('				<div class="ciga_list_nav_condition_area_div">');
        html.push('					<div class="ciga_list_nav_condition_area_div_text">');
        html.push('						<span class="ciga_list_nav_condition_area_div_text_tag">价格</span>：<span class="ciga_list_nav_condition_area_div_text_tagvalue">25元（含）--45元、25元（含）--45元、25元（含）--45元、25元（含）--45元</span>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_nav_condition_area_div_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-638px -24px;"></div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('			<div tag="label" class="ciga_list_nav_condition_area" style="display:none;"> > </div>');
        html.push('			<div tag="label" class="ciga_list_nav_condition_area" style="display:none;">');
        html.push('				<div class="ciga_list_nav_condition_area_div">');
        html.push('					<div class="ciga_list_nav_condition_area_div_text">');
        html.push('						<span class="ciga_list_nav_condition_area_div_text_tag">标签</span>：<span class="ciga_list_nav_condition_area_div_text_tagvalue">热销、新品</span>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_nav_condition_area_div_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-638px -24px;"></div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('			<div onclick="ciga_list_nav_condition_clearall()" id="ciga_list_nav_search" class="ciga_list_nav_search btn_success" style="display:none;">清空筛选条件</div>');
        html.push('		');
        html.push('		</div>');
        html.push('		<div id="ciga_list_condition_box" class="clearfix ciga_list_condition_box">');
        html.push('			<div id="ciga_list_company" class="ciga_list_company">');
        html.push('				<div class="ciga_list_tagname">工业公司：</div>');
        html.push('					<div id="ciga_list_tagarea_company" class="ciga_list_tagarea">');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_more" class="ciga_list_btn" tag="company" icon="more">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">更多</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-698px -24px;"></div>');//-698px -24px
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_multi" class="ciga_list_btn" tag="company" icon="multi">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">多选</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" icon="multi" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-668px -24px;"></div>');//-668px -24px
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_cancel" class="ciga_list_btn" tag="company" icon="cancel" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">取消</div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_ok" class="ciga_list_btn" tag="company" icon="ok" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">确定</div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('			<div id="ciga_list_pinpai" class="ciga_list_pinpai">');
        html.push('				<div class="ciga_list_tagname">品牌：</div>');
        html.push('				<div id="ciga_list_tagarea_pinpai" class="ciga_list_tagarea">');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_more" class="ciga_list_btn" tag="pinpai" icon="more">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">更多</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-698px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_multi" class="ciga_list_btn" tag="pinpai" icon="multi">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">多选</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" icon="multi" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-668px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_cancel" class="ciga_list_btn" tag="pinpai" icon="cancel" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">取消</div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_ok" class="ciga_list_btn" tag="pinpai" icon="ok" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">确定</div>');
        html.push('				</div>');
        html.push('			</div>');

        //价格区间	
        html.push('			<div id="ciga_list_pricearea" class="ciga_list_pricearea">');
        html.push('				<div class="ciga_list_tagname">零售价区间：</div>');
        html.push('				<div id="ciga_list_tagarea_price" class="ciga_list_tagarea">');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_more" class="ciga_list_btn" tag="pricearea" icon="more">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">更多</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-698px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_multi" class="ciga_list_btn" tag="pricearea" icon="multi">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">多选</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" icon="multi" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-668px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_cancel" class="ciga_list_btn" tag="pricearea" icon="cancel" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">取消</div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_ok" class="ciga_list_btn" tag="pricearea" icon="ok" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">确定</div>');
        html.push('				</div>');
        html.push('			</div>');

        //指定价格 
        html.push('			<div id="ciga_list_price" class="ciga_list_price">');
        html.push('				<div class="ciga_list_tagname">指定价格：</div>');
        html.push('				<div class="ciga_list_tagarea">');
        html.push('					<div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">');
        html.push('							<input id="ciga_list_price_ok_start" type="text" style="width:100px;"> -- <input id="ciga_list_price_ok_end" type="text" style="width:100px;">');
        html.push('							<div class="ciga_list_price_ok_btn btn_success" onclick="ciga_list_price_ok(this)">确定</div>');
        html.push('						</div>');
        html.push('					</div>');
        html.push('				</div>');
        html.push('			</div>');

        //标签	 
        html.push('			<div id="ciga_list_label" class="ciga_list_label">');
        html.push('				<div class="ciga_list_tagname">标签：</div>');
        html.push('				<div class="ciga_list_tagarea">');
        // html.push('					<div class="ciga_list_tag" tag="1" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        // html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        // html.push('						<div name="tag_text" class="ciga_list_tag_text">热销</div>');
        // html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="2" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">新品</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="3" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">进口雪茄</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="4" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">国产雪茄</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="5" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">爆珠</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="6" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">细支</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="7" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">中支</div>');
        html.push('					</div>');
        html.push('					<div class="ciga_list_tag" tag="8" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
        html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
        html.push('						<div name="tag_text" class="ciga_list_tag_text">短支</div>');
        html.push('					</div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_more" class="ciga_list_btn" tag="label" icon="more">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">更多</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-698px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_multi" class="ciga_list_btn" tag="label" icon="multi">');
        html.push('					<div name="btn_text" class="ciga_list_btn_text">多选</div>');
        html.push('					<div name="btn_icon" class="ciga_list_btn_icon" icon="multi" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-668px -24px;"></div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_cancel" class="ciga_list_btn" tag="label" icon="cancel" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">取消</div>');
        html.push('				</div>');
        html.push('				<div name="ciga_list_btn_ok" class="ciga_list_btn" tag="label" icon="ok" style="display:none;">');
        html.push('					<div class="ciga_list_btn_text">确定</div>');
        html.push('				</div>');
        html.push('			</div>');
        html.push('		</div>');

        //排序栏 
        html.push('		<div class="ciga_list_order">');
        html.push('			<div onclick="ciga_list_orderby(this)" id="ciga_list_product_code" class="ciga_list_product_code">');
        html.push('				<div name="text" class="ciga_list_order_text">条条形码</div>');
        html.push('				<div name="icon" tag="desc" class="ciga_list_order_desc" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-position:-728px -25px;"></div>');
        html.push('			</div>');
        html.push('			<div onclick="ciga_list_orderby(this)" id="ciga_list_whole_sale_price"  class="ciga_list_whole_sale_price">');
        html.push('				<div name="text" class="ciga_list_order_text" style="">价格</div>');
        html.push('				<div name="icon" tag="desc" class="ciga_list_order_desc" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-position:-898px -25px;"></div>');
        html.push('			</div>');
        html.push('		</div>');


        //卷烟清单	 
        html.push('		<div id="ciga_list_list" class="ciga_list_list">');
        html.push('		</div>');
        html.push('	</div>');
        html.push('	<div id="page_bar" class="page_bar">');
        html.push('</div>');

        return html.join('');
    }
        , this.getDataHTML = function (baseroot, jparam) {
            return this.getHTML(baseroot, jparam);
        }
        , this.getParams = function () {
            var jparams = [
                { "name": "网站名称", "field": "webname", "group": "自定义信息", "value": "杭州烟草电子商务网站", "editor": "text" }
                , { "name": "联系电话", "field": "phone", "group": "自定义信息", "value": "", "editor": "text" }
            ];
            return jparams;
        }
        , this.init = function (jparam) {
            _USER_TYPE = $.getLoginUser().user_type;// CUSTOMER、STAFF、SELLER
            var baseroot = 'wdk?action=ecw.file&method=attachment_download&fileid=';
            // 设置目录高亮：
            $('#frm_menu').find('li').eq(1).addClass('frm_menu_item_selected').siblings().removeClass('frm_menu_item_selected');
            //标签的 悬浮|移出|点击 事件的绑定
            /*
            $('.ciga_list_tag').bind('mouseover',function(){ciga_list_tag_over(this);});
            $('.ciga_list_tag').bind('mouseout',function(){ciga_list_tag_out(this);});
            $('.ciga_list_tag').bind('click',function(){ciga_list_tag_click(this);});
            */

            //按钮的 悬浮|移出|点击 事件的绑定
            $('.ciga_list_btn').bind('mouseover', function () { ciga_list_btn_over(this); });
            $('.ciga_list_btn').bind('mouseout', function () { ciga_list_btn_out(this); });
            $('.ciga_list_btn').bind('click', function () { ciga_list_btn_click(this); });

            //条目图片的点击
            //	$('.ciga_list_list_item_content').bind('click',function(){ciga_list_item_click(this);});

            //加入购物车
            //	$('.ciga_list_list_item_addcart').bind('click',function(){ciga_list_item_addcart(this);});

            //删除查询条件的事件
            $('.ciga_list_nav_condition_area_div_icon').bind('click', function () { ciga_list_nav_condition_close(this); });


            //各类查询条件
            var company_ids = '';			//查询条件：工业公司
            var company_names = '';
            var pinpai_ids = '';			//查询条件：品牌
            var pinpai_names = '';
            var price_ids = '';				//查询条件：价格区间
            var price_names = '';
            var label_ids = '';				//查询条件：标签
            var label_names = '';

            var orderby_field = '';			//排序字段	product_code 	whole_sale_price
            var orderby_pos = '';			//排序方向	desc	asc

            //解析并组织查询参数
            //列表页面初始化，获取外部传入的各类参数
            /*
                var jcondi = {
                    company_ids:''
                    ,company_names:''
                    ,pinpai_ids:''
                    ,pinpai_names:''
                    ,price_low_id:''
                    ,price_low_name:''
                    ,price_high_id:''
                    ,price_high_name:''
                    ,label_ids:''
                    ,label_names:''			
                }
    
            */
            var condition = $.getURLParam('condition');

            if ('' != condition) {
                condition = Base64.decode(condition);
                //查询条件预存
                $('#ciga_list_condition').val(condition);
                if (!condition || '' == condition) {
                    condition = '{}';
                }
                var jcondi = $.str2json(condition);

                company_ids = jcondi.company_ids ? jcondi.company_ids : '';
                company_names = jcondi.company_names ? jcondi.company_names : '';
                pinpai_ids = jcondi.pinpai_ids ? jcondi.pinpai_ids : '';
                pinpai_names = jcondi.pinpai_names ? jcondi.pinpai_names : '';
                price_ids = jcondi.price_ids ? jcondi.price_ids : '';
                price_names = jcondi.price_names ? jcondi.price_names : '';
                label_ids = jcondi.label_ids ? jcondi.label_ids : '';
                label_names = jcondi.label_names ? jcondi.label_names : '';

                orderby_field = jcondi.orderby_field ? jcondi.orderby_field : '';
                orderby_pos = jcondi.orderby_pos ? jcondi.orderby_pos : '';
                //alert('222  orderby_field='+orderby_field+'   orderby_pos='+orderby_pos)
                if (orderby_field && "" != orderby_field) {
                    var div_icon = $('#ciga_list_' + orderby_field).find("div[name='icon']")[0];
                    $(div_icon).attr('tag', orderby_pos);
                    if ('desc' == orderby_pos) {
                        $(div_icon).css('background-position', '-728px -25px');
                    } else {
                        $(div_icon).css('background-position', '-898px -25px');
                    }
                    //上 -898px -25px;
                    //下 -728px -25px
                }
            }




            var search_fields = new Object();
            /*
            1	卷烟编码	factory_uuid	string		厂家编码，多个之间用逗号分隔
            2	卷烟名称	brand_uuid	string		品牌编码，多个之间用逗号分隔
            3	批发价区间	whole_sale_price	JSONArray		>=最小值//
                                                                <最大值
            4	标签	tag	string		热销1、新品2、进口雪茄3、国产雪茄4，可多选，多个之间用逗号分隔
            */

            var _isShowClearBtn = false;
            //查询条件：厂家编码
            if ('' != company_ids) {
                search_fields.factory_uuid = company_ids;
                //隐藏厂家选择
                $('#ciga_list_company').css('display', 'none');
                //修改导航栏显示			
                $(".ciga_list_nav_condition_area[tag='company']").css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='company']").find(".ciga_list_nav_condition_area_div_text_tagvalue").text(company_names);

                _isShowClearBtn = true;
            } else {
                //需要显示厂家列表，则首先查询所有厂家，然后显示厂家条件区域
                $.cuajax({
                    url: _PUB_URL2
                    , data: {
                        _SRVNAME: 'service.ecw.portlet.catalog'
                        , _SRVMETHOD: 'queryFactoryList'
                        , _DATA: $.json2str({
                            cust_uuid: $.getLoginUser().cust_uuid
                            , op_acc: $.getLoginUser().account_uuid
                            , result_fields: 'factory_uuid,factory_name,simple_name'
                            , order_fields: 'display_order'
                        })
                    }
                    , success: function (result) {
                        var jres = $.str2json(result);
                        if ('0' == jres.code) {
                            return;
                        }
                        var html = new Array();
                        var rows = jres.resultset;
                        for (var i = 0; i < rows.length; i++) {
                            var row = rows[i];
                            html.push('					<div class="ciga_list_tag" tag="' + row.factory_uuid + '" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
                            html.push('						<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
                            html.push('						<div name="tag_text" class="ciga_list_tag_text">' + row.simple_name + '</div>');
                            html.push('					</div>');
                        }
                        $("#ciga_list_tagarea_company").html(html.join(''));
                    }
                    , error: function (result) {
                        alert('网络错误！result=' + result);
                    }
                });
                $('#ciga_list_company').css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='company']").css('display', 'none');
                search_fields.factory_uuid = '';

            }

            //查询条件：卷烟品牌
            if ('' != pinpai_ids) {
                search_fields.brand_uuid = pinpai_ids;
                //隐藏厂家选择
                $('#ciga_list_pinpai').css('display', 'none');
                $(".ciga_list_nav_condition_area[tag='pinpai']").css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='pinpai']").find(".ciga_list_nav_condition_area_div_text_tagvalue").text(pinpai_names);
                //修改导航栏显示

                _isShowClearBtn = true;
            } else {
                //需要显示卷烟品牌，则首先查询所有品牌，然后显示品牌条件区域
                //如果已经选了厂家，则需要把厂家UUID加上
                $.cuajax({
                    url: _PUB_URL2
                    , data: {
                        _SRVNAME: 'service.ecw.portlet.catalog'
                        , _SRVMETHOD: 'queryBrandListByFactoryId'
                        , _DATA: $.json2str({
                            cust_uuid: $.getLoginUser().cust_uuid
                            , op_acc: $.getLoginUser().account_uuid
                            , factory_uuid: search_fields.factory_uuid
                            , result_fields: 'brand_uuid,brand_name'
                            , order_fields: 'display_order'
                        })
                    }
                    , success: function (result) {
                        var jres = $.str2json(result);
                        if ('0' == jres.code) {
                            return;
                        }
                        var html = new Array();
                        var rows = jres.resultset;
                        for (var i = 0; i < rows.length; i++) {
                            var row = rows[i];
                            html.push('				<div class="ciga_list_tag" tag="' + row.brand_uuid + '" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
                            html.push('					<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
                            html.push('					<div name="tag_text" class="ciga_list_tag_text">' + row.brand_name + '</div>');
                            html.push('				</div>');
                        }
                        $("#ciga_list_tagarea_pinpai").html(html.join(''));
                    }
                    , error: function (result) {
                        alert('网络错误！result=' + result);
                    }
                });
                $('#ciga_list_pinpai').css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='pinpai']").css('display', 'none');
                search_fields.brand_uuid = '';
            }

            //查询条件：价格区间
            if ('' != price_ids) {
                //隐藏价格选择和指定价格
                $('#ciga_list_pricearea').css('display', 'none');
                $('#ciga_list_price').css('display', 'none');

                var prices = new Array();
                var arr = price_ids.split(',');
                for (var i = 0; i < arr.length; i++) {
                    var str = arr[i];
                    var _price = new Object();
                    _price.start = str.split('-')[0];
                    _price.end = str.split('-')[1];
                    if (str.split('-')[2]) {
                        _price.rule = str.split('-')[2];
                    } else {
                        _price.rule = '';
                    }
                    prices.push(_price);
                }

                $(".ciga_list_nav_condition_area[tag='price']").css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='price']").find(".ciga_list_nav_condition_area_div_text_tagvalue").text(price_names);
                search_fields.whole_sale_price = prices;

                _isShowClearBtn = true;
            } else {
                //需要显示价格区间，则首先查询所有价格区间，然后显示价格区间条件区域
                $.cuajax({
                    // ,data:{
                    // 	_SRVNAME:'service.wdk.pub'
                    // 	,_SRVMETHOD:'wql_query'
                    // 	,_DATA:$.json2str({
                    // 			modulecode:'S_CC_CIGA_WHOLE_PRICERANGE'
                    // 			,jparam:{}
                    // 	})
                    // }, 
                    data: {
                        _SRVNAME: 'service.ecw.portlet.catalog',
                        _SRVMETHOD: 'queryPriceRange',
                        _DATA: $.json2str({
                            cust_uuid: $.getLoginUser().cust_uuid,
                            op_acc: $.getLoginUser().account_uuid
                        })
                    },
                    success: function (result) {
                        var jres = $.str2json(result);
                        if ('0' == jres.code) {
                            return;
                        }
                        var html = new Array();
                        var rows = jres.resultset;
                        for (var i = 0; i < rows.length; i++) {
                            var row = rows[i];
                            var _order_index = row.order_index;
                            html.push('<div class="ciga_list_tag" tag="' + row.begin_price + '-' + row.end_price + '" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
                            html.push('	<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
                            html.push('	<div name="tag_text" class="ciga_list_tag_text">' + row.price_range_name + '</div>');
                            html.push('</div>');

                            // var _sysdic_para3 = row.sysdic_para3;
                            // if (_sysdic_para3) {
                            // 	html.push('				<div class="ciga_list_tag" tag="'+row.sysdic_para1+'-'+row.sysdic_para2+'-'+_sysdic_para3+'" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
                            // } else {
                            // 	html.push('				<div class="ciga_list_tag" tag="'+row.sysdic_para1+'-'+row.sysdic_para2+'" onmouseover="ciga_list_tag_over(this)" onmouseout="ciga_list_tag_out(this)" onclick="ciga_list_tag_click(this)">');
                            // }

                            // html.push('					<div name="tag_icon"  class="ciga_list_tag_icon" style="background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;"></div>');
                            // html.push('					<div name="tag_text" class="ciga_list_tag_text">'+row.sysdic_name+'</div>');
                            // html.push('				</div>');

                        }
                        $("#ciga_list_tagarea_price").html(html.join(''));
                    }
                    , error: function (result) {
                        alert('网络错误！result=' + result);
                    }
                });
                $('#ciga_list_pricearea').css('display', 'block');
                $('#ciga_list_price').css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='price']").css('display', 'none');
                search_fields.whole_sale_price = new Array();
            }

            //查询条件：卷烟品牌
            if ('' != label_ids) {
                search_fields.tag = label_ids;
                //隐藏厂家选择
                $('#ciga_list_label').css('display', 'none');
                $(".ciga_list_nav_condition_area[tag='label']").css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='label']").find(".ciga_list_nav_condition_area_div_text_tagvalue").text(label_names);

                _isShowClearBtn = true;
            } else {
                $('#ciga_list_label').css('display', 'block');
                $(".ciga_list_nav_condition_area[tag='label']").css('display', 'none');
                search_fields.tag = '';
            }

            //TODO: 暂时隐藏标签
            // $("#ciga_list_price").css("border-bottom","0px");
            // $('#ciga_list_label').hide();

            // 处理清空筛选条件按钮显示状态
            if (_isShowClearBtn) {
                $('#ciga_list_nav_search').show();
            } else {
                $('#ciga_list_nav_search').hide();
            }


            //	alert('search_fields='+$.json2str(search_fields));

            //	return;
            //注册分页方法
            var orderby_fields = '';
            if (orderby_field && '' != orderby_field && orderby_pos && '' != orderby_pos) {
                orderby_fields = orderby_field + ' ' + orderby_pos;
            }

            if (!$('#ciga_list_condition_box').children(':visible').length) {
                $('#ciga_list_condition_box').css('border', '0');
            } else {
                $('#ciga_list_condition_box').children(':visible').last().css('border-bottom', '0');
            }

            console.log({
                user_type: $.getLoginUser().user_type
                , user_uuid: $.getLoginUser().cust_uuid
                , op_acc: $.getLoginUser().account_uuid
                , search_fields: search_fields
                , order_fields: orderby_fields
            });
            //alert('排序字段 '+orderby_fields)
            $.pagebar({
                id: 'page_bar'
                , page_size: 16
                , queryParams: {
                    _SRVNAME: 'service.ecw.portlet.catalog'
                    , _SRVMETHOD: 'pageQueryWithUserType'
                    , _DATA: $.json2str({
                        user_type: $.getLoginUser().user_type
                        , user_uuid: $.getLoginUser().cust_uuid
                        , op_acc: $.getLoginUser().account_uuid
                        , search_fields: search_fields
                        , order_fields: orderby_fields
                    })
                    , _RSTYPE: 'grid'
                    , _RSFIELD: 'resultset'
                    , _RSPARAM: $.json2str({ pagequery: '1' })
                }
                , onPage: function (jres) {
                    var nTotal = jres.total;			//总记录数
                    var jrows = jres.rows;				//当前分页记录

                    var html = new Array();
                    $('#ciga_list_list').html(html.join(''));
                    for (var i = 0; i < jrows.length; i++) {
                        var jrow = jrows[i];
                        /*
                        1	卷烟标识		product_uuid		String		
                        2	管理单元标识	manage_unit_uuid	String		
                        3	卷烟编码		product_code		String		
                        4	卷烟名称		product_name		String		
                        5	卷烟照片		photo_fid			String		
                        6	批发价			whole_sale_price	String		
                        7	零售价			retail_price		String		
                        8	厂家简称		factory_simple_name	String		
                        9	包装类型		product_style_code	String		
                        10	货源属性		supply_fully		String		
                        11	是否进口烟		is_intake			String		
                        12	品牌标识		brand_uuid			String		
                        13	品牌名称		brand_name			String		
                        14	卷烟价类		price_type_code		String		
                        15	卷烟价类		price_type_codename	String		
                    	
                        扩展信息说明如下：
                        序号	中文名称	英文名称	数据类型	约束	说明
                        1	扩展信息主键	ext_uuid	String		
                        2	显示名称		show_name	String		
                        3	宣传口号		slogan		String		
                        4	展示标签1		show_tag1	String		
                        5	展示标签2		show_tag2	String		
                        6	展示标签3		show_tag3	String		
                        7	上架状态		onsale		String		
                        8	定时上架时间	on_time		String		
                        9	定时下架时间	off_time	String		
                        10	详情			remark		String		
                        11	图片个数		img_count	String		查询图片表统计出来的
阿黄、小彭、天宝、俞斌、小郑
                        */
                        var _show_tag1 = jrow.show_tag1 || '';
                        var _show_tag2 = jrow.show_tag2 || '';
                        var _show_tag3 = jrow.show_tag3 || '';
                        html.push('			<div class="ciga_list_list_item" item_id="' + jrow.product_uuid + '">');
                        html.push('				<div class="ciga_list_list_item_content" onclick="ciga_list_item_click(this)">');
                        html.push('					<div class="ciga_list_list_item_title">' + jrow.show_name + '</div>');
                        html.push('					<div class="ciga_list_list_item_title2 text_warning">' + jrow.slogan + '</div>');
                        html.push('					<div>');
                        html.push('						<div class="ciga_list_list_item_img">');
                        html.push('							<img src="' + (baseroot + (jrow.img_main || '')) + '">');
                        html.push('						</div>');
                        html.push('						<div class="ciga_list_list_item_txt">');
                        if (_show_tag1) {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag1 + '">' + _show_tag1 + '</div>');
                        } else {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag1 + '" style="background:white;">' + _show_tag1 + '</div>');
                        }
                        if (_show_tag2) {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag2 + '">' + _show_tag2 + '</div>');
                        } else {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag2 + '" style="background:white;">' + _show_tag2 + '</div>');
                        }
                        if (_show_tag3) {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag3 + '">' + _show_tag3 + '</div>');
                        } else {
                            html.push('							<div class="ciga_list_show_tag ellipsis" title="' + _show_tag3 + '" style="background:white;">' + _show_tag3 + '</div>');
                        }
                        html.push('							<div class="ciga_list_item_product_code">条条形码：' + jrow.bar_code2 + '</div>');
                        html.push('							<div class="ciga_list_factory_simple_name">工业公司：' + jrow.factory_simple_name + '</div>');
                        html.push('						</div>');
                        html.push('					</div>');
                        if (jrow.off_time) {
                            html.push('				<span class="public_offtime">即将下架</span>');
                        }
                        html.push('				</div>');
                        html.push('				<div class="ciga_list_list_item_bar">');
                        html.push('					<div class="ciga_list_list_item_bar_price">');
                        html.push('						<div class="ciga_list_list_item_bar_price_t">批发价：<span class="text_warning">￥' + jrow.whole_sale_price + '元/条</span></div>');
                        html.push('						<div class="ciga_list_list_item_bar_price_b">建议零售价：￥' + jrow.retail_price + '元/条</div>');
                        html.push('					</div>');
                        if (_USER_TYPE != 'STAFF') {
                            html.push('					<div class="ciga_list_list_item_addcart btn_warning" onclick="ciga_list_item_addcart(this)">加入购物车</div>');
                        }
                        html.push('				</div>');
                        html.push('			</div>');
                    }

                    $('#ciga_list_list').append(html.join(''));
                    $('body').trigger('error_evt', $('#ciga_list_list'));
                    $('#ciga_list_count').text(nTotal);
                }
            });
        }
};
//点击排序
function ciga_list_orderby(div) {
    var div_name = $(div).find("div[name='text']")[0];
    var div_icon = $(div).find("div[name='icon']")[0];

    var _txt = $(div_name).text();
    var _order = $(div_icon).attr("tag");

    var orderby_field = '';
    var orderby_pos = '';
    if ('条条形码' == _txt) {
        orderby_field = 'bar_code2';
    } else {
        orderby_field = 'whole_sale_price';
    }
    if ('desc' == _order) {
        orderby_pos = "asc";
    } else {
        orderby_pos = "desc";
    }

    var jcondi = new Object();
    var condition = $.getURLParam('condition');
    if (condition && '' != condition) {
        condition = Base64.decode(condition);
        //	alert(condition);
        jcondi = $.str2json(condition);
    }

    jcondi.orderby_field = orderby_field;
    jcondi.orderby_pos = orderby_pos;
    condition = Base64.encode($.json2str(jcondi));
    $.page_redirect('page_cigalist', 'condition=' + condition);

}


//标签项悬浮
function ciga_list_tag_over(div) {
    var div_icon = $(div).find("div[name='tag_icon']")[0];
    var div_text = $(div).find("div[name='tag_text']")[0];
    var className = $(div_text).attr('class');

    if ('ciga_list_tag_text_selected' == className) {
        return;
    }
    $(div_icon).css('background-position', '-453px -66px');
    $(div_text).attr('class', 'ciga_list_tag_text_over');
}

//标签项移出
function ciga_list_tag_out(div) {
    var div_icon = $(div).find("div[name='tag_icon']")[0];
    var div_text = $(div).find("div[name='tag_text']")[0];
    var className = $(div_text).attr('class');
    if ('ciga_list_tag_text_selected' == className) {
        return;
    }
    $(div_icon).css('background-position', '-420px -66px');
    $(div_text).attr('class', 'ciga_list_tag_text');

}

//标签项点击
function ciga_list_tag_click(div) {
    var list_tag = $(div).parent().parent().attr('id');		//ciga_list_pinpai
    var div_icon = $(div).find("div[name='tag_icon']")[0];
    var div_text = $(div).find("div[name='tag_text']")[0];
    var div_icon_display = $(div_icon).css('display');
    if ('none' == div_icon_display) {
        //	alert('复选框隐藏，说明是单选，值：'+$(div).attr('id'));
        var jcondi = $.str2json($('#ciga_list_condition').val());
        if (!jcondi) {
            jcondi = new Object();
        }
        var _id = $(div).attr('tag');

        var _name = $(div_text).text();

        switch (list_tag) {
            case 'ciga_list_company':
                jcondi.company_ids = _id;
                jcondi.company_names = _name;
                break;
            case 'ciga_list_pinpai':
                jcondi.pinpai_ids = _id;
                jcondi.pinpai_names = _name;
                break;
            case 'ciga_list_pricearea':
                jcondi.price_ids = _id;
                jcondi.price_names = _name;
                break;
            case 'ciga_list_label':
                jcondi.label_ids = _id;
                jcondi.label_names = _name;
                break;
            default:
                break;
        }

        //跳到卷烟列表
        $.ciga_list(jcondi);


    } else {
        var className = $(div_text).attr('class');

        //如果是已经选中的，则再次点击取消选中
        if ('ciga_list_tag_text_selected' == className) {
            $(div_icon).css('background-position', '-420px -66px');
            $(div_text).attr('class', 'ciga_list_tag_text');
        } else {
            $(div_icon).css('background-position', '-486px -66px');
            $(div_text).attr('class', 'ciga_list_tag_text_selected');
        }
    }
}

//background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-698px -24px;
//background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-668px -24px;
//图标 更多|多选  鼠标悬浮
function ciga_list_btn_over(div) {
    var div_icon = $(div).find("div[name='btn_icon']")[0];
    var div_text = $(div).find("div[name='btn_text']")[0];
    var _icon = $(div).attr('icon');
    var _text = $(div_text).text();

    $(div).css("border", "1px solid #a6985f");
    $(div_text).css('color', "#a6985f");
    if ('more' == _icon) {

        if ("收起" == _text) {

            //$(div_icon).css('background-position','-790px -10px');
        } else {
            $(div_icon).css('background-position', '-840px -24px');
        }
    } else {
        $(div_icon).css('background-position', '-782px -24px');
    }

}

//图标 更多|多选  鼠标移出
function ciga_list_btn_out(div) {
    var div_icon = $(div).find("div[name='btn_icon']")[0];
    var div_text = $(div).find("div[name='btn_text']")[0];
    var _icon = $(div).attr('icon');
    var _text = $(div_text).text();

    $(div).css("border", "1px solid #bfbfbf");
    $(div_text).css('color', "#444");
    if ('more' == _icon) {
        if ("收起" == _text) {
            //$(div_icon).css('background-position','-698px -24px');
        } else {
            $(div_icon).css('background-position', '-698px -24px');
        }
    } else {
        $(div_icon).css('background-position', '-668px -24px');
    }
}

//图标点击 更多（more）|多选（multi） 弹出下拉区域
function ciga_list_btn_click(div) {
    var jcondi = $.str2json($('#ciga_list_condition').val());
    if (!jcondi) {
        jcondi = new Object();
    }
    var _div = $(div);
    var tag = _div.attr('tag');
    var icon = _div.attr('icon');

    var div_tag = $('#ciga_list_' + tag);
    //标签显示区域
    var div_area = $(div_tag).find(".ciga_list_tagarea");

    //4个按钮
    var btn_more = $(div_tag).find("div[name='ciga_list_btn_more']")[0];
    var btn_multi = $(div_tag).find("div[name='ciga_list_btn_multi']")[0];
    var btn_ok = $(div_tag).find("div[name='ciga_list_btn_ok']")[0];
    var btn_cancel = $(div_tag).find("div[name='ciga_list_btn_cancel']")[0];

    if ('more' == icon) {
        var btn_more_text = $(btn_more).find('.ciga_list_btn_text');
        var btn_more_icon = $(btn_more).find('.ciga_list_btn_icon');

        //点击更多	
        var _overflow = $(div_area).css('overflow');
        if ('hidden' == _overflow) {
            //1、隐藏->展开
            //逻辑说明：
            //	a、取消高度限制和隐藏限制
            $(div_area).css('overflow', 'auto');
            $(div_area).css('height', '100%');

            //	b、将“更多”按钮右边小图标换成向上的
            $(btn_more_icon).css('background-position', '-870px -24px');
            $(btn_more_text).text('收起');

        } else {
            //2、展开->隐藏
            //	a、恢复高度限制（45px），增加超出隐藏（overflow=hidden）
            $(div_area).css('overflow', 'hidden');
            $(div_area).css('height', '45px');

            //	b、将“更多”按钮右边小图标换成向下的
            $(btn_more_icon).css('background-position', '-698px -24px');
            $(btn_more_text).text('更多');

        }

    } else if ('multi' == icon) {
        //点击多选
        var _overflow = $(div_area).css('overflow');
        var btn_more_display = $(btn_more).css('display');



        if ('hidden' == _overflow) {
            //1、隐藏->展开
            //逻辑说明：
            //	a、取消高度限制和隐藏限制
            $(div_area).css('overflow', 'auto');
            $(div_area).css('height', '100%');

            //	b、将“更多”和“多选”按钮隐藏
            $(btn_more).css('display', 'none');
            $(btn_multi).css('display', 'none');

            //	c、将“确定”和“取消”按钮显示
            $(btn_ok).css('display', 'block');
            $(btn_cancel).css('display', 'block');

            //	d、放开标签多选框
            $(div_tag).find('.ciga_list_tag_icon').css('display', 'block');

        } else {
            //2、展开->隐藏
            //首先判断当前是否弹出是“更多”弹出的还是“多选”弹出的
            if ('none' != btn_more_display) {
                //如果是点击更多弹出的，则进行如下处理
                //	a、恢复“收起”的字样为“更多”
                //$(btn_more_icon).css('background-position','-38px 0px');
                //$(btn_more_text).text('更多');

                //	b、隐藏“更多”按钮
                $(btn_more).css('display', 'none');
                $(btn_multi).css('display', 'none');

                //	c、显示“确定”和“取消”按钮
                $(btn_ok).css('display', 'block');
                $(btn_cancel).css('display', 'block');

                //	d、放开标签的多选框
                $(div_tag).find('.ciga_list_tag_icon').css('display', 'block');
            } else {
                //	a、恢复高度限制（45px），增加超出隐藏（overflow=hidden）
                $(div_area).css('overflow', 'hidden');
                $(div_area).css('height', '45px');

                //	b、隐藏“确定”和“取消”按钮
                $(btn_more).css('display', 'block');
                $(btn_multi).css('display', 'block');

                //	c、恢复显示“更多”和“多选”按钮
                $(btn_ok).css('display', 'none');
                $(btn_cancel).css('display', 'none');
            }
        }
    } else if ('ok' == icon) {
        //点击确定
        //	0、取值
        var arr_id = new Array();
        var arr_name = new Array();
        $(div_tag).find("div[name='tag_text']").each(function () {
            var div_text = $(this);
            var _class = div_text.attr('class');
            //收集选中的值
            if ('ciga_list_tag_text_selected' == _class) {
                arr_id.push(div_text.parent().attr('tag'));
                arr_name.push(div_text.text());
            }
        });

        //alert('选中的标签类型：'+tag);
        //alert('选中的值：'+arr.join(','));
        switch (tag) {
            case 'company':
                jcondi.company_ids = arr_id.join(',');
                jcondi.company_names = arr_name.join('、');
                break;
            case 'pinpai':
                jcondi.pinpai_ids = arr_id.join(',');
                jcondi.pinpai_names = arr_name.join('、');
                break;
            case 'pricearea':
                jcondi.price_ids = arr_id.join(',');
                jcondi.price_names = arr_name.join('、');
                break;
            case 'label':
                jcondi.label_ids = arr_id.join(',');
                jcondi.label_names = arr_name.join('、');
                break;
            default:
                break;
        }

        //跳到卷烟列表
        $.ciga_list(jcondi);

        /*
        //	a、取消所有选中并隐藏所有复选框		
        $(div_tag).find("div[name='tag_icon']").css('display','none');
        $(div_tag).find("div[name='tag_icon']").css('background-position','-0px -17px');
        $(div_tag).find("div[name='tag_text']").attr('class','ciga_list_tag_text');
    	
        //	a、恢复高度限制（45px），增加超出隐藏（overflow=hidden）
        $(div_area).css('overflow','hidden');
        $(div_area).css('height','45px');

        //	b、隐藏“确定”和“取消”按钮
        $(btn_more).css('display','block');
        $(btn_multi).css('display','block');

        //	c、恢复显示“更多”和“多选”按钮
        $(btn_ok).css('display','none');
        $(btn_cancel).css('display','none');
        */


    } else {
        //点击取消
        //	a、取消所有选中并隐藏所有复选框		
        $(div_tag).find("div[name='tag_icon']").css('display', 'none');
        $(div_tag).find("div[name='tag_icon']").css('background-position', '-420px -66px');
        $(div_tag).find("div[name='tag_text']").attr('class', 'ciga_list_tag_text');
        //background:url(wdk?action=ecw.file&method=attachment_download&fileid=ecw_icon_icon);background-repeat:no-repeat;background-position:-420px -66px;
        //	a、恢复高度限制（45px），增加超出隐藏（overflow=hidden）
        $(div_area).css('overflow', 'hidden');
        $(div_area).css('height', '45px');

        //	b、隐藏“确定”和“取消”按钮
        $(btn_more).css('display', 'block');
        $(btn_multi).css('display', 'block');

        //	c、恢复显示“更多”和“多选”按钮
        $(btn_ok).css('display', 'none');
        $(btn_cancel).css('display', 'none');

    }
}

//指定价格的确定按钮点击
function ciga_list_price_ok(div) {
    var jcondi = $.str2json($('#ciga_list_condition').val());
    if (!jcondi) {
        jcondi = new Object();
    }
    var start = $('#ciga_list_price_ok_start').val();
    var end = $('#ciga_list_price_ok_end').val();
    if (!start) {
        start = '0';
    }
    if (!end) {
        end = '10000';
    }
    if (isNaN(start) || isNaN(end)) {
        alert("请输入正确的价格！");
        return;
    }
    jcondi.price_ids = start + '-' + end;
    jcondi.price_names = start + '元（含）以下-' + end + '元';


    //跳到卷烟列表
    $.ciga_list(jcondi);
}

//导航栏查询条件关闭
function ciga_list_nav_condition_close(div) {
    $('#ciga_list_nav_search').hide();
    var jcondi = $.str2json($('#ciga_list_condition').val());
    if (!jcondi) {
        jcondi = new Object();
    }
    var tag = $(div).parent().parent().attr('tag');
    switch (tag) {
        case 'company':
            jcondi.company_ids = '';
            jcondi.company_names = '';
            break;
        case 'pinpai':
            jcondi.pinpai_ids = '';
            jcondi.pinpai_names = '';
            break;
        case 'price':
            jcondi.price_ids = '';
            jcondi.price_names = '';
            break;
        case 'label':
            jcondi.label_ids = '';
            jcondi.label_names = '';
            break;
        default:
            break;
    }

    //跳到卷烟列表
    $.ciga_list(jcondi);
}

//清空所有查询条件
function ciga_list_nav_condition_clearall() {
    //跳到卷烟列表
    $.ciga_list(new Object());
}


//条目图片的点击
function ciga_list_item_click(div) {
    var item_id = $(div).parent().attr('item_id');
    //alert('查看详情：item_id='+item_id);
    $.addLog('卷烟列表页面', '进入卷烟详情界面，卷烟product_uuid=' + item_id);
    $.page_open("page_listdetail", "product_uuid=" + item_id);
}

//加入购物车
function ciga_list_item_addcart(div) {
    var item_id = $(div).parent().parent().attr('item_id');
    //alert('加入购物车：item_id='+item_id);
    $.cuajax({
        url: _PUB_URL2
        , data: {
            _SRVNAME: 'service.ecw.buy.shoppingcart'
            , _SRVMETHOD: 'create'
            , _DATA: $.json2str({
                /*
                1	操作账号标识	op_account_uuid		String	必填	对应syscreatoruuid
                2	操作员标识		op_person_uuid		String	必填	对应cust_uuid
                3	所属管理单元	manage_unit_uuid	String	必填	
                4	分公司ID		company_uuid		String	必填	
                5	商品ID			product_uuid		String	必填	
                6	商品分类		product_type		String			00：卷烟（默认）；01：非烟
                */
                op_account_uuid: $.getLoginUser().account_uuid
                , op_person_uuid: $.getLoginUser().cust_uuid
                , manage_unit_uuid: $.getLoginUser().manage_unit_uuid
                , company_uuid: $.getLoginUser().corp_uuid
                , product_uuid: item_id
                , product_type: '00'

            })
        }
        , success: function (result) {
            var jres = $.str2json(result);
            // layer.msg(jres.desc);
            // alert(jres.desc);
            if ('1' == jres.code) {
                $.addLog('卷烟列表页面', '商品product_uuid=' + item_id + '，加入购物车');
                frm_banner_animateaddtocart && frm_banner_animateaddtocart(div);
            }
        }
        , error: function (result) {
            alert('网络错误！result=' + result);
        }
    });

}